package com.morningstar.qs.basic.db.bean;

import java.io.Serializable;


/**
 * This is an object that contains data related to the WorkspaceCategoryInfo table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="WorkspaceCategoryInfo"
 */

public class WorkspaceCategoryInfo  implements Serializable {

/*	public static String REF = "WorkspaceCategoryInfo";
	public static String PROP_CATEGORY_NAME = "CategoryName";
	public static String PROP_CREATE_TIME = "CreateTime";
	public static String PROP_ID = "Id";
	public static String PROP_USER_ID = "UserId";
	public static String PROP_LAST_UPDATE_TIME = "LastUpdateTime";*/


	/**
	 * 
	 */
	private static final long serialVersionUID = 1088827282809920713L;



	// constructors
	public WorkspaceCategoryInfo () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public WorkspaceCategoryInfo (java.lang.Integer id) {
		this.setCategoryId(id);
		initialize();
	}

	/**
	 * Constructor for required fields
	 */
	public WorkspaceCategoryInfo (
		java.lang.Integer categoryId,
		java.lang.Integer userId,
		java.lang.String categoryName,
		java.util.Date createTime,
		java.util.Date lastUpdateTime) {

		this.setCategoryId(categoryId);
		this.setUserId(userId);
		this.setCategoryName(categoryName);
		this.setCreateTime(createTime);
		this.setLastUpdateTime(lastUpdateTime);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer categoryId;

	// fields
	private java.lang.Integer userId;
	private java.lang.String categoryName;
	private java.util.Date createTime;
	private java.util.Date lastUpdateTime;



	/**
	 * Return the unique identifier of this class
     * @hibernate.categoryId
     *  generator-class="sequence"
     *  column="CategoryId"
     */
	public java.lang.Integer getCategoryId () {
		return categoryId;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setCategoryId (java.lang.Integer categoryId) {
		this.categoryId = categoryId;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: UserId
	 */
	public java.lang.Integer getUserId () {
		return userId;
	}

	/**
	 * Set the value related to the column: UserId
	 * @param userId the UserId value
	 */
	public void setUserId (java.lang.Integer userId) {
		this.userId = userId;
	}



	/**
	 * Return the value associated with the column: CategoryName
	 */
	public java.lang.String getCategoryName () {
		return categoryName;
	}

	/**
	 * Set the value related to the column: CategoryName
	 * @param categoryName the CategoryName value
	 */
	public void setCategoryName (java.lang.String categoryName) {
		this.categoryName = categoryName;
	}



	/**
	 * Return the value associated with the column: CreateTime
	 */
	public java.util.Date getCreateTime () {
		return createTime;
	}

	/**
	 * Set the value related to the column: CreateTime
	 * @param createTime the CreateTime value
	 */
	public void setCreateTime (java.util.Date createTime) {
		this.createTime = createTime;
	}



	/**
	 * Return the value associated with the column: LastUpdateTime
	 */
	public java.util.Date getLastUpdateTime () {
		return lastUpdateTime;
	}

	/**
	 * Set the value related to the column: LastUpdateTime
	 * @param lastUpdateTime the LastUpdateTime value
	 */
	public void setLastUpdateTime (java.util.Date lastUpdateTime) {
		this.lastUpdateTime = lastUpdateTime;
	}




	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof com.morningstar.qs.basic.db.bean.WorkspaceCategoryInfo)) return false;
		else {
			com.morningstar.qs.basic.db.bean.WorkspaceCategoryInfo workspaceCategoryInfo = (com.morningstar.qs.basic.db.bean.WorkspaceCategoryInfo) obj;
			if (null == this.getCategoryId() || null == workspaceCategoryInfo.getCategoryId()) return false;
			else return (this.getCategoryId().equals(workspaceCategoryInfo.getCategoryId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getCategoryId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getCategoryId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}